import {Sequelize} from "sequelize";
import EnvVars from "@src/declarations/major/EnvVars";

const sequelize = new Sequelize(
    //配置数据库
    EnvVars.mysql.dataBase,
    //配置用户名
    EnvVars.mysql.userName,
    //配置密码
    EnvVars.mysql.passWord,
    {
        // 设置端口
        host: EnvVars.mysql.host,
        // 配置数据库类型
        dialect: "mysql",
        //日志输出
        logging: EnvVars.debug ? console.log : false,
    }
)

export default sequelize;